package com.zbkj.crmeb.task.order;

import com.xxl.job.core.handler.annotation.XxlJob;
import com.zbkj.crmeb.store.service.StoreOrderGroupInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Configuration
public class OrderRefundBySystem {
    //日志
    private static final Logger logger = LoggerFactory.getLogger(OrderRefundByUser.class);


    @Autowired
    private StoreOrderGroupInfoService storeOrderGroupInfoService;

    /**
     * 超过72小时拼团订单自动退款(五分钟一次)
     * @author daigb
     * @date:  2022-12-13 09:51
     */
    @XxlJob("orderRefundBySystem")
    public void init(){
        try {
            storeOrderGroupInfoService.overtimeAutoRefund();
        } catch (Exception e){
            e.printStackTrace();
            logger.error("OrderRefundBySystem.task" + " | msg : " + e.getMessage());
        }
    }
}
